<?php

namespace app\adminapi\controller;

use think\Controller;

class Login extends BaseApi
{
    public function captcha(){
        //验证码标识
        $uniqud = uniqid(mt_rand(100000,999999));
        $data = [
            'src' => captcha_src($uniqud),
           'uniqud' => $uniqud,
        ];
        $this-> ok($data);
    }
    public function login(){
      
        $param = input();
        $validate = $this->validate($param,[
            'username|用户名' => 'require',
            'password|密码' => 'require',   
            'code|验证码' =>'require',
            'uniqid|验证码标识' =>'require',

        ]);
        if($validate!=true){
            $this->fail($validate);
        }
    }
}
